<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('type')->nullable()->unsigned()->comment('订单类型');
            $table->string('orderType')->nullable()->comment('订单单别');
            $table->string('orderNo')->nullable()->comment('订单单号');
            $table->dateTime('date')->nullable()->comment('单据日期');
            $table->integer('clientId')->nullable()->comment('客户id');
            $table->string('clientName')->nullable()->comment('客户');
            $table->integer('sellId')->nullable()->comment('销售id');
            $table->string('sellName')->nullable()->comment('销售姓名');
            $table->integer('ordererId')->nullable()->comment('销售id');
            $table->string('ordererName')->nullable()->comment('销售姓名');
            $table->integer('buyerId')->nullable()->comment('采购id');
            $table->string('buyerName')->nullable()->comment('采购姓名');
            $table->string('buyerPaymentState')->nullable()->comment('采购付款信息');
            $table->dateTime('deliverDate')->nullable()->comment('发货时间');
            $table->date('startDate')->nullable()->comment('开始时间');
            $table->date('endDate')->nullable()->comment('完工时间');
            $table->integer('state')->nullable()->comment('订单状态');
            $table->integer('refund')->nullable()->comment('退款状态');
            $table->integer('result')->nullable()->comment('收货信息');
            $table->string('expressType')->nullable()->comment('快递');
            $table->string('express')->nullable()->comment('快递');
            $table->string('expressState')->nullable()->comment('快递1状态');
            $table->float('expressCost',11,2)->nullable()->comment('快递费');
            $table->string('expressNo')->nullable()->comment('快递单号');
            $table->string('express2')->nullable()->comment('快递');
            $table->string('expressNo2')->nullable()->comment('快递单号');
            $table->string('expressState2')->nullable()->comment('快递2状态');
            $table->float('expressCost2',11,2)->nullable()->comment('快递费2');
            $table->float('imprest',11,2)->nullable()->comment('预付款');
            $table->float('pay',11,2)->nullable()->comment('支付');
            $table->string('payUnit')->nullable()->comment('支付单位');
            $table->string('payState')->nullable()->comment('支付状态');
            $table->float('cost',11,2)->nullable()->comment('总价');
            $table->string('costUnit')->nullable()->comment('总价单位');
            $table->string('costState')->nullable()->comment('付款状态');
            $table->string('costType')->nullable()->comment('付款方式');
            $table->string('costNo')->nullable()->comment('付款帐号');
            $table->dateTime('costDate')->nullable()->comment('付款时间');
            $table->float('receipt',11,2)->nullable()->comment('收款');
            $table->string('receiptUnit')->nullable()->comment('收款单位');
            $table->string('receiptState')->nullable()->comment('收款状态');
            $table->string('receiptType')->nullable()->comment('付收款方式');
            $table->string('receiptNo')->nullable()->comment('付收款帐号');
            $table->dateTime('receiptDate')->nullable()->comment('收款时间');
            $table->string('notes')->nullable()->comment('备注');
            $table->string('other1')->nullable()->comment('其他信息');
            $table->string('other2')->nullable()->comment('其他信息');
            $table->string('other3')->nullable()->comment('其他信息');
            $table->string('other4')->nullable()->comment('其他信息');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('orders');
    }
}
